package com.nfit.shopweb.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nfit.shopmodel.entity.base.ProductUnit;
import com.nfit.shopweb.mapper.ProductUnitMapper;
import com.nfit.shopweb.service.ProductUnitService;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:ProductUnitServiceImpl
 * Package:com.nfit.shopweb.service.impl
 * Description
 *
 * @Author L
 * @Create 2024/12/17 9:06
 */
@Schema(description = "商品单位业务实现")
@Service
public class ProductUnitServiceImpl implements ProductUnitService {

    @Autowired
    private ProductUnitMapper productUnitMapper;

    @Override
    public PageInfo<ProductUnit> page(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ProductUnit> list = productUnitMapper.page();
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }

    @Override
    public List<ProductUnit> selectAll() {
        return productUnitMapper.selectAll();
    }
}
